package com.my.home.modules.service.serviceImpl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.my.home.modules.entity.User;
import com.my.home.modules.mapper.UserMapper;
import com.my.home.modules.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Al Sah-him on 2018/5/24.
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements UserService{

    @Autowired
    UserMapper mapper;

    @Override
    public User getById(String id) {
        return mapper.getById(id);
    }

    @Override
    public List<User> selectByLoginName(User uservo) {
        Wrapper<User> wrapper=new EntityWrapper<>(uservo);
        return mapper.selectList(wrapper);
    }
}
